package com.imy.common.util;

public class ColorUtils {

    public static int[] parserRGB(int color) {
        int red = (color & 0xff0000) >> 16;
        int green = (color & 0x00ff00) >> 8;
        int blue = (color & 0x0000ff);
        return new int[]{red, green, blue};
    }

    public static String integerToHex(int color) {
        String s = Integer.toHexString(color);
        if (s.length() == 8) {
            return "#" + s.substring(2);
        }
        return "#" + s;
    }
}
